<template>
  <div class="shaoapp-container" >
    <div class="shaoboxfirst" style="font-size: 20px">
    </div>
    <el-dialog
      :visible.sync="centerDialogVisible"
      :showClose="false"
      width="70%"
      center
      >
      <div class="yupaotanchu1">
        确定归还该浴袍？
        <el-row>
          <el-col :span="12">
            <el-button   style="float: left" class="buttonqueding" type="danger" @click.prevent.stop.native="quxiao" plain >取消</el-button>
          </el-col>
          <el-col :span="12">
        <el-button   style="float: left" class="buttonqueding" type="danger" @click.prevent.stop.native="queding" plain >确定</el-button>
            </el-col>
        </el-row>
      </div>
    </el-dialog>
      <!--中间主体部分-->
    <el-row >
      <el-col v-for="(item,index) in detailsList1" :key="index" :span="24" :offset="index%3===0?0:''">
        <el-card style="width: 90%;margin-left: 5%;margin-top: 35px; border-radius: 20px;" shadow="always"  @click.prevent.stop.native= "check1(item.id);">

          <div style="display: flex; flex-direction: column;">
            <div style="display: flex;font-size: 40px">
              <el-row style="width: 100%">
                <el-col :span="3">
                  <div style="display: flex;  flex-direction: row; padding-right: 20px;">
                    <el-image :src="cardClass(item.projectCategory)" style="height: 80%;width:80%"></el-image>
                  </div>
                </el-col>
                <el-col :span="15">
                  <div style="display: flex; justify-content: space-between; align-items: center;">
                    <div style="margin-top: 20px;">手牌号:{{ item.handBrand }}</div>
                    <div style="margin-top: 20px;">单价:{{ item.unitPrice }}元</div>
                  </div>
<!--                  <el-button v-if="xiangxilist.consumptionStatus==0" v-hasPermi="['shop:change:tuidan']" style="float: left" class="add_btn9" type="danger" @click.prevent.stop.native="tuidan" plain >退单</el-button>-->
<!--                  <div>-->
<!--                    <el-button v-if="xiangxilist.consumptionStatus==0" v-hasPermi="['shop:change:tuidan']" style="float: left" class="add_btn9" type="danger" @click.prevent.stop.native="tuidan" plain >退单</el-button>-->
<!--                  </div>-->
                  <div style="display: flex; justify-content: space-between; align-items: center;"> <!-- 剩余两个项目，并列显示 -->
                    <div style="display: flex; justify-content: flex-start; align-items: center;"> <!-- 录单员工居右 -->
                      <div>项目名称:{{ item.entryName }}</div>
                    </div>
                    <div style="display: flex; justify-content: flex-end; align-items: center;">
                      <div>个数:{{ item.quantity }}个</div>
                    </div>
                  </div>
                </el-col>
                <el-col   :span="6">
                  <el-button  v-hasPermi="['shop:change:tuidan']" style="float: left" class="add_btn9" type="danger" @click.prevent.stop.native="tuidan(item.id)" plain >归还</el-button>
                  <!--  <el-button  v-if="xiangxilist.consumptionStatus==1" v-hasPermi="['shop:change:tuidan']" style="float: left" class="add_btn9" type="danger" @click.prevent.stop.native="tuidan(item.id)" plain >已退单</el-button>-->
                </el-col>
<!--                <el-button style="float: left" class="add_btn9" type="danger" @click.prevent.stop.native="tuidan" plain >退单</el-button>-->


              </el-row>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <el-card style="width: 90%;margin-left: 5%;margin-top: 35px; border-radius: 20px;" shadow="always"
      v-if="detailsList1.length==0"  class="kong">
      该手牌未租借浴袍
    </el-card>
    <el-button plain type="primary" round
               style="font-size: 20px;width: 150px;height: 60px;margin-right: 5%;margin-top: 3%;margin-bottom: 3%; float:right" @click="back()">返回
    </el-button>
  </div>

</template>
<script>
  import { listDetails, getDetails, delDetails, addDetails, updateDetails,listyupao } from "@/api/module/shao/details";
  import { listBaseinfo, getBaseinfo, delBaseinfo, addBaseinfo, updateBaseinfo } from "@/api/module/shao/baseinfo";
  export default {
    name: "index1",
    dicts: ['yinhe_demo'],
    inject:['reload'],
    data() {
      return {
        xiangxilist:[],
        centerDialogVisible: false,
        activeNames: ['1'],
        drawer: false,
        direction: 'ttb',
        // 遮罩层

        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 消费详细表格数据
        detailsList1:[],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,

        // 查询消费详细表参数
        consumptiondetail: {
          pageNum: 1,
          pageSize: 100,
          userId: null,
          deptId: null,
          department: null,
          nickName: null,
          userName: null,
          post: null,
          handBrand: null,
          handCategory: null,
          handState: 1,
          retentionStatus: null,
          mergeStatus: null,
          openingTime: null,
          drawTime: null,
          mergeHands: null,
          mergeBarBillsId: null,
          leaveTime: null,
          beforeLeave: null,
          beforeBarBillsId: null,
          entryName: null,
          projectCategory: null,
          projectCode: null,
          mnemonicCode: null,
          unit: null,
          unitPrice: null,
          commissionPrice: null,
          together: null,
          sailingsSigns: null,
          barBillsId: null,
          recordingTime: null,
          quantity: null,
          totalAmount: null,
          seat: null,
          orderNumber: null,
          paymentMethod: null,
          consumptionStatus: '0',
          chargebackTime: null,
          reasonForChargeback: null,
          chargebackProcessorAccount: null,
          chargebackProcessorName: null,
          clockTime: null,
          nextClockTime: null,
          nextClockStatus: null,
          recordEmployeeNumber: null,
          recorderEmployeeName: null,
          roomType: null,
          openingHours: null,
          checkOutTime: null,
          checkOutStatus: null,
          note1: null,
          note2: null,
          note3: null,
          note4: null,
          note5: null,
          note6: null,
          note7: null,
          note8: null,
          note9: null,
          note10: null
        },
        // 表单参数
        form: {},
      };
    },

    created() {
      this.getdetailsList();
      var A;
      A=this.$route.query.chuan


    },
    methods:{
      cardClass() {
        return  require(`../../../../assets/icons/imageicon/34.png`); // 成功状态的颜色类名
      },
      tuidan(id){
        this.centerDialogVisible=true;
        getDetails(id).then(response => {
          this.xiangxilist = response.data;
        })

      },
      quxiao(){
        this.centerDialogVisible=false;
      },
      queding(){
        this.xiangxilist.consumptionStatus=1;
        this.xiangxilist.reasonForChargeback="浴服归还"
        updateDetails(this.xiangxilist).then(response => {
          this.$modal.msgSuccess("归还成功");
          this.centerDialogVisible=false;
          this.reload();
        });
      },
      check1(ids){
        this.centerDialogVisible = true;
        const id = ids
        this.loading=true;
        getDetails(id).then(response => {
          this.xiangxilist = response.data;
        })
        this.loading=false;
        console.log("=====")
        console.log(this.xiangxilist)
      },
      handleChange(val) {
        console.log(val);
      },
      back() {
        this.$router.push({ path:"/yuquangong/zujie"});
      },
    // 查询项目信息表只查自己管辖范围内的
    getdetailsList() {
      this.consumptiondetail.handBrand=this.$route.query.chuan;
      this.loading = true;
      listyupao(this.consumptiondetail).then(response => {
        this.detailsList1 = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        pageNum: 1,
        pageSize: 10,
        hand_brand: null,
        opening_time: null,
        group_id: null,
        cardiner: null,
        checkout: null,
        department: null,
        checkout_time: null,
        front_sign: null,
        front_print_time: null,
        operator: null,
        checkout_location: null,
        graduationSchool: null,
        note1: null,
      };
      this.resetForm("form");
    },
    /** 退单按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            this.form.consumptionStatus=1;
            updateDetails(this.form).then(response => {
              this.$modal.msgSuccess("退单成功");
              this.open = false;
              this.$router.go(0);
            });
          }
        }
      });
    },
  }};
</script>

<style >
  /*
  .el-tabs__item{color:red ;}
  */
  .shaoapp-container{
    border: 10px;
    border-bottom: #1e1e1e;
  }
  #tab-fourth{
    color: red;
  }
  #tab-fifth{
    color: #dada25;
  }
  #tab-sixth{
    color: green;
  }
  #tab-seventh{
    color: orange;
  }
  /* 样式穿透，修改组件库组件的样式 */
  .el-tabs__item.is-top.is-active {
    /* v-bind可以绑定变量 */
    background-color: rgba(231, 226, 226, 0.77);
  }
  .status{
    color: #00afff;
  }
  .status1{
    color: #dd524d;
  }


  .shaoboxfirst{
    width: 100%;
    height: 40px;
  }
  .boxsecond{
    width: 100%;

  }
  .chicun{
    height: 320px;
  }
  .ruzhen {
    position: absolute;

  }
  .tuidan{
    width: 200px;
    height: 60px;
    font-size: 20px;
  }
  .aa{
    font-size: 20px;
  }
  .shaohandtext {
    font-size: 50px;
    text-align: center;
  }

  .shaohanditem {
    margin-bottom: 10px;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }
  .zitida{
    font-size: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .yanse{
    color: #dd524d;
  }
 .jinggao{
    font-size: 40px;
 }
 .add_btn9{
   margin-top: 26px;
   min-width: 300px;
   min-height: 100px;
   font-size: 40px;
   font-size: 40px;
   margin-left: 50px;
 }
 .buttonqueding{
   margin-left: 70px;
   font-size: 40px;
   min-width: 300px;
   min-height: 100px;
   margin-top: 200px;
 }
  .shaobox-card {
    width: 100%;
    position: relative;
  }
  .kapian{
    font-size: 45px;
    text-align: center;
  }
  .yupaotanchu1{
    text-align: center;
    font-size: 60px;
    margin-top: 150px;
    height: 450px;
  }
  .kong{
    height: 300px;
    line-height: 230px;
    text-align: center;
    font-size: 80px;
  }
  .shaocard-bg {
    position: absolute; /* 背景层需要绝对定位 */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /*background-image: url(''); !* 设置背景图片 *!*/
    background-size: cover; /* 使背景图片自适应卡片大小 */
    z-index: -1; /* 将背景层 z-index 设为 -1，以保证不会遮挡卡片内容 */
  }
</style>

